package cn.lucky.rules.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lingpeng.jiang
 * @create 2020-12-16-23:53  自定义ribbon负载均衡策略
 */
@Configuration
public class MySlefRules {

    /**
     * 随机策略
     * @return
     */
    @Bean
    public IRule mySelfRule(){
        return new RoundRobinRule();
    }
}
